package create.singleton;

/**
 * Created by lie on 2017/10/30.
 * 饿汉模式
 * 基于类加载模式，所以线程安全
 * 但假如这个实例没用过，则造成浪费
 */
public class HDemo {
    private static HDemo instance = new HDemo();
    private HDemo(){}

    public static HDemo getInstance(){
        return instance;
    }

}
